package com.aqie.advanced.automatic.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;

@Service
@Profile("Java8")       // 条件装配
@Slf4j
public class CommonCalculateService implements CalculateService {
    @Override
    public Integer sum(Integer... values) {
        log.info("java 8 sum");
        int sum = 0;
        for (Integer value : values) {
            sum += value;
        }
        return sum;
    }
}
